package com.twu.biblioteca;

import com.twu.book.Book;

import java.io.PrintStream;
import java.util.ArrayList;
import java.util.Iterator;

/**
 * Created with IntelliJ IDEA.
 * User: root
 * Date: 7/11/13
 * Time: 12:32 AM
 * To change this template use File | Settings | File Templates.
 */
public class MovieList {


    private static ArrayList<Movie> movielist = new ArrayList<Movie>();

    public MovieList() {
    }

    public static void insertMovie(Movie movie) {
        movielist.add(movie);
    }

    public static void listall(PrintStream output) {
        //To change body of created methods use File | Settings | File Templates.
        Iterator<Movie> movie = movielist.iterator();
        output.print("Movie\t\tYear\t\tDirector\t\tRating\n");
        while(movie.hasNext())
        {
            Movie it = movie.next();
            output.print(it.getMoviename()+"\t\t"+it.getMovietime()+"\t\t"+it.getMoviedirector()+"\t\t"+it.getRating()+"\n");
        }
    }
}
